package org.sdv.managedbean.interceptor;

import javax.interceptor.AroundInvoke;
import javax.interceptor.Interceptor;
import javax.interceptor.InvocationContext;

import org.sdv.managedbean.interceptor.annotation.AddMethodLogger;

@Interceptor
@AddMethodLogger
public class AddCalculatorServiceInterceptor {

	@AroundInvoke
	public Object invokeLogger(InvocationContext context) throws Exception {
			System.out.println("\n2) AddCalculatorServiceInterceptor:AroundInvoke:invokeLogger");
			System.out.println("2.1) Method name is '" + context.getMethod().getName() + "'.");
			System.out.println("2.2) First parameter is '" + context.getParameters()[0] + "'.");
			System.out.println("2.3) Second parameter is '" + context.getParameters()[1] + "'.");
			System.out.println("");
			return context.proceed();
	}	
}